package com.woniuxy.entity;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @Author 罗蔚
 * @Date 2022/4/7 20:08
 * @Description TODO
 */
@Data
//@ConfigurationProperties(prefix = "datasource-my")
@PropertySource("classpath:my.properties")
@Component
public class MyDataSourceEntity {
    //datasourceMy.url
    //大写变小写, 前面加-
    @Value("${datasource-my.url}")
    String url;
    @Value("${datasource-my.username}")
    String username;
    @Value("${datasource-my.password}")
    String password;
}
